package com.cn.wxwinnie.java.io;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

/**
 * @author 潇湘暮雨 E-mail:wxwinnie@hotmail.com
 * 
 * @version 创建时间：2014年3月25日 下午7:48:18
 * 
 */
public class ImageWR {
	public static byte[] fileRead(String fpath) throws IOException {
		File f = new File(fpath);
		FileInputStream is = new FileInputStream(f);
		byte[] content = new byte[is.available()];
		int b = 0;
		int n = 0;
		while (true) {
			b = is.read();
			if (b != -1) {
				if (n >= 3)
					b = ImageFileTools.changeColor((byte) b);
				content[n] = (byte) b;
				n++;
			} else
				break;
		}
		is.close();
		return content;
	}
}
